package com.wangsd.common.mq;


import com.github.binarywang.wxpay.bean.request.WxPayOrderQueryRequest;
import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryResult;
import com.github.binarywang.wxpay.constant.WxPayConstants;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.wangsd.common.component.WeixinPayService;
import com.wangsd.common.component.WxPayServiceExt;
import com.wangsd.common.constant.MqConstant;
import com.wangsd.web.face.entity.Merchant;
import com.wangsd.web.face.entity.TOrder;
import com.wangsd.web.face.service.MemberService;
import com.wangsd.web.face.service.MerchantService;
import com.wangsd.web.face.service.TOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * facePay订单查询
 */

@Component
@RabbitListener(queues = MqConstant.RABBITMQ_FACEPAY_IS_MEMBER)
@Slf4j
public class CheckIsMemberReceive {
    @Autowired
    MemberService memberService;


    @RabbitHandler
    public void process(CheckMember checkMember) {
        try {
            memberService.checkIsToMember(checkMember.getMerchandId(), checkMember.getOpenId(),
                    checkMember.getSubOpenId(), checkMember.getPhone(), checkMember.getIsSend(), checkMember.getOrderId(),checkMember.getPayType());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
